const path = require("path");
const fs = require("fs");
const Wrapper = require("./../lib/v0.0.1").Wrapper

// Wrapper.__getSessionId();

Wrapper.__login().then(async o => {
  let _v = await o.instance.verify();
  let _u = await o.instance.uploadStream(fs.createReadStream(path.join(__dirname, "./index.js")))
  let _speed = await o.instance.getUploadSpeed(path.join(__dirname, "../index.js"));
  let _uf = await o.instance.uploadFile(
    path.join(__dirname, "../node_modules/axios/CHANGELOG.md"),
    7 * 1024
  );
  let _ud = await o.instance.safelyUploadDir(path.join(__dirname,
    "../tmp/"), 50 * 1024 * 1024);
  let html = _ud.toHTML();
  debugger
  require("../lib/v0.0.1").speed_test(__filename);
  debugger
  let o_valid1 = await Wrapper.getValidInstance();
  await new Promise(r => setTimeout(r), 5000);
  let o_valid2 = await Wrapper.getValidInstance();
  console.log(o_valid1.instance === o_valid2.instance)
})